package org.wcms.surrounded.modules;

import org.wcms.surrounded.Constants;
import org.wcms.surrounded.model.User;

import com.google.gson.Gson;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
import com.google.inject.name.Names;

public class SurroundedGeneralModule extends AbstractModule {

    @Override
    protected void configure() {

        // Gson is thread safe (in the general case)
        bind(Gson.class).in(Singleton.class);
        
        User newUser = new User();
        newUser.setId(Constants.SURROUNDED_NEW_USER_ID);
        newUser.setUserName(Constants.SURROUNDED_NEW_USER_NAME);
        
        bind(User.class).annotatedWith(Names.named(Constants.SURROUNDED_NEW_USER_NAME)).toInstance(newUser);
        
    }

}
